:root {
    --primary-green: #10B981;
    --auxiliary-blue: #3B82F6;
    --accent-orange: #F59E0B;
    --neutral-dark-gray: #1F2937;
    --neutral-light-gray: #F9FAFB;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--neutral-light-gray); /* 浅灰 */
    color: var(--neutral-dark-gray);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 移除原有的 header 样式，因为已替换为 navbar 模板 */
header {
    display: none;
}

/* 导航栏样式 (来自 layout/navbar.html，在此处确保统一) */
.navbar {
    background-color: var(--primary-green) !important; /* 使用主色调 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.navbar-brand,
.navbar-nav .nav-link {
    color: white !important;
    font-weight: bold;
    transition: text-decoration 0.2s;
}
.navbar-nav .nav-link:hover {
    text-decoration: underline;
}

main.container {
    flex: 1;
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0; /* 容器本身不带内边距，交给内部卡片 */
    display: block; /* 改为 block 布局，下级 section 再使用 grid */
}

.section-title {
    color: var(--neutral-dark-gray);
    font-size: 1.8em;
    margin-bottom: 25px;
    font-weight: bold;
    display: flex;
    align-items: center;
}
.section-title .fas {
    margin-right: 10px;
    color: var(--primary-green);
}

/* 数据概览区 */
.dashboard-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.card {
    background-color: white;
    padding: 25px;
    border-radius: 12px; /* 更大的圆角 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* 基础阴影 */
    text-align: left;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
    position: relative;
    overflow: hidden; /* 隐藏超出部分，防止动画时内容溢出 */
}
.card:hover {
    transform: translateY(-5px); /* 向上浮动 */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* 阴影加深 */
}
.card h3 {
    color: var(--primary-green); /* 主色调 */
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}
.card h3 .fas {
    margin-right: 10px;
    font-size: 1.2em;
}
.card p {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}
.card .current-value {
    font-size: 1.8em; /* 突出当前值 */
    color: var(--neutral-dark-gray);
}
.card .change-info,
.card .status-info,
.card .target-info {
    font-size: 0.9em;
    font-weight: normal;
    color: #666;
}
.card#caloriesCard .current-value,
.card#caloriesCard .target-info {
    color: var(--accent-orange); /* 热量数据使用强调色 */
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    height: 10px;
    margin-top: 10px;
}
.progress-bar {
    height: 100%;
    width: 0%; /* Will be set by JS */
    background-color: var(--primary-green); /* 进度条使用主色调 */
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

/* 趋势分析区 */
.trend-analysis-section .card {
    padding: 30px;
}
.trend-analysis-section .btn-outline-secondary {
    color: var(--primary-green);
    border-color: var(--primary-green);
    transition: all 0.2s;
}
.trend-analysis-section .btn-outline-secondary:hover,
.trend-analysis-section .btn-outline-secondary.active {
    background-color: var(--primary-green);
    color: white;
}

/* 功能模块区 */
.function-modules-section .row {
    margin-top: 20px;
}
.module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: var(--neutral-dark-gray);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
    height: 150px; /* 固定高度，保持一致性 */
}
.module-card:hover {
    transform: translateY(-5px) scale(1.02); /* 上浮并轻微放大 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); /* 阴影加深 */
}
.module-card .fas {
    font-size: 3em;
    margin-bottom: 10px;
}
.module-card p {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
}

/* 功能模块卡片颜色 */
.module-card.module-personal .fas,
.module-card.module-dietplan .fas,
.module-card.module-foodlibrary .fas,
.module-card.module-healthindex .fas,
.module-card.module-exerciserecord .fas,
.module-card.module-healthgoal .fas {
    color: var(--primary-green); /* 默认图标颜色 */
}

.module-card.module-dietplan .fas, .module-card.module-dietplan p {
    color: var(--auxiliary-blue);
}
.module-card.module-foodlibrary .fas, .module-card.module-foodlibrary p {
    color: var(--accent-orange);
}

/* 近期记录区 */
.recent-records-section .card {
    padding: 0; /* Tab 内容区自行控制 padding */
}
.recent-records-section .nav-tabs {
    border-bottom: 1px solid #dee2e6; /* Bootstrap 默认 */
}
.recent-records-section .nav-link {
    color: var(--neutral-dark-gray);
    transition: color 0.2s, border-color 0.2s;
}
.recent-records-section .nav-link.active {
    color: var(--primary-green);
    border-color: var(--primary-green) var(--primary-green) #fff; /* 活动 tab 底部无边框 */
}
.recent-records-section .table th {
    background-color: var(--neutral-light-gray);
    color: var(--neutral-dark-gray);
}

/* 推荐计划区 */
.recommended-plans-section .hide-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.recommended-plans-section .hide-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
.plan-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    min-width: 300px; /* 固定宽度 */
    flex-shrink: 0;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
}
.plan-card:hover {
    transform: translateY(-5px); /* 上浮 */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}
.plan-card h4 {
    color: var(--primary-green);
    font-size: 1.3em;
    margin-bottom: 10px;
}
.plan-card p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
}
.plan-card .btn-primary {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    transition: all 0.2s;
}
.plan-card .btn-primary:hover {
    background-color: #0c8a66; /* 更深的绿色 */
    border-color: #0c8a66;
}

footer {
    text-align: center;
    padding: 1.5em 0;
    background-color: var(--neutral-dark-gray); /* 深灰 */
    color: white;
    position: relative;
    width: 100%;
    margin-top: 40px; /* 底部留白 */
}

/* 动画效果 */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card,
.module-card,
.plan-card {
    animation: fadeInScale 0.5s ease-out;
}

/* 移除不再需要的 Material Icons 样式 */
.material-icons {
    display: none; /* 隐藏 Material Icons */
}

/* 通用按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.btn-primary {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}
.btn-primary:hover {
    background-color: #0c8a66;
    border-color: #0c8a66;
}
.btn-outline-secondary {
    background-color: white;
    border-color: #ccc;
    color: #666;
}
.btn-outline-secondary:hover {
    background-color: #f0f0f0;
}

/* Existing general styles (kept or modified) */
.container {
    /* Existing container styles are overridden by main.container */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 10px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select {
    width: calc(100% - 22px);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    margin-right: 5px;
}

.btn-danger {
    background-color: #f44336;
}

.btn:hover {
    opacity: 0.9;
} 